package com.zhuqiao.server2.service;

import com.zhuqiao.server2.entity.Test;
import com.zhuqiao.server2.mapper.TestMapper;
import com.zhuqiao.tm.annotation.GlobalTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;

@Service
public class TestService {
    @Autowired
    private TestMapper testMapper;

    @GlobalTransactional(isEnd = true, total = "2")
    @Transactional
    public void aa() {
        Test test = new Test();
        test.setNum(2);
        test.setName("server2");
        testMapper.insert(test);



        int a = 10 /0;
    }
}
